<template>
  <div>
      班名<input type="text" v-model="name">
      班级人数<input type="text" v-model="num">
      讲师<input type="text" v-model="teacher">
      <input type="button" value="登录" @click="btn">
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            name:'',
            num:'',
            teacher:''
        }
    },methods:{
        btn(){
            const fd={
                'name':this.name,
                'num':this.num,
                'teacher':this.teacher
            }
          axios.post('http://127.0.0.1:8000/addclass',fd).then(resp=>{
              console.log(resp.data)
              alert(resp.data.msg)
              console.log(resp.data.status)
          }).catch(error=>{
              console.log(error)
          })  
        }
    }
}
</script>

<style>

</style>